Skip to content

[ef-32] refactor: rename CLI flags, config fields, and config filename#28

Merged
NiveditJain merged 1 commit into
mainfrom
ef-32
Apr 7, 2026
Merged

[ef-32] refactor: rename CLI flags, config fields, and config filename#28
NiveditJain merged 1 commit into
mainfrom
ef-32

Conversation

@NiveditJain

@NiveditJain NiveditJain commented Apr 7, 2026

Copy link
Copy Markdown
Member

Summary

  • --custom-hooks--custom for --install-policies; --remove-custom-hooks--custom moved to --remove-policies
  • --beta-only--beta for --remove-policies (consistent with install)
  • customHooksPathcustomPoliciesPath across all source, tests, and docs
  • hooks-config.jsonpolicies-config.json (and hooks-config.local.jsonpolicies-config.local.json) in all path references
  • --help / -h command added with full usage output
  • Unknown flag error now appends: Run \failproofai --help` for usage details.`

Test plan

  • failproofai --help prints full usage and exits 0
  • failproofai -h same
  • failproofai --install-policies --custom ./my-policies.js sets customPoliciesPath in policies-config.json
  • failproofai --remove-policies --custom clears customPoliciesPath
  • failproofai --remove-policies --beta removes only beta policies
  • Unknown flag (e.g. --foo) prints did-you-mean + help hint
  • Existing unit and e2e tests pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added --help / -h command to display CLI usage and examples.
  • Breaking Changes

    • Configuration files renamed: hooks-config.jsonpolicies-config.json
    • Configuration field renamed: customHooksPathcustomPoliciesPath
    • CLI flag renamed: --custom-hooks--custom (for --install-policies)
    • CLI flag renamed: --remove-custom-hooks--custom (for --remove-policies)
  • Documentation

    • Updated all guides, CLI reference, and configuration documentation to reflect naming changes.

…e for clarity

- --custom-hooks → --custom (install), --remove-custom-hooks → --custom (remove)
- --beta-only → --beta for --remove-policies
- customHooksPath → customPoliciesPath throughout source, tests, and docs
- hooks-config.json → policies-config.json (and hooks-config.local.json → policies-config.local.json)
- Add --help / -h command with full usage output
- Unknown flag error now hints to run --help

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 7913e68c-74bd-4c9e-9f69-9c0421ead3cf

📥 Commits

Reviewing files that changed from the base of the PR and between 3cce580 and 44c1b34.

📒 Files selected for processing (26)
  • README.md
  • __tests__/e2e/helpers/fixture-env.ts
  • __tests__/e2e/hooks/config-scopes.e2e.test.ts
  • __tests__/e2e/hooks/custom-hooks.e2e.test.ts
  • __tests__/hooks/block-read-outside-cwd.test.ts
  • __tests__/hooks/custom-hooks-loader.test.ts
  • __tests__/hooks/hooks-config.test.ts
  • __tests__/hooks/manager.test.ts
  • app/actions/get-hooks-config.ts
  • app/policies/hooks-client.tsx
  • bin/failproofai.mjs
  • docs/architecture.md
  • docs/cli-reference.md
  • docs/configuration.md
  • docs/custom-hooks.md
  • docs/dashboard.md
  • docs/getting-started.md
  • docs/index.md
  • docs/testing.md
  • scripts/postinstall.mjs
  • src/hooks/custom-hooks-loader.ts
  • src/hooks/handler.ts
  • src/hooks/hooks-config.ts
  • src/hooks/llm-client.ts
  • src/hooks/manager.ts
  • src/hooks/policy-types.ts

📝 Walkthrough

Walkthrough

The PR systematically renames configuration and CLI terminology from "hooks" to "policies" across the codebase. This includes updating configuration file paths from hooks-config.json to policies-config.json, renaming the configuration field customHooksPath to customPoliciesPath, changing the CLI flag --custom-hooks to --custom, and updating documentation and tests accordingly. A new --help CLI flag was added.

Changes

Cohort / File(s) Summary
Documentation
README.md, docs/architecture.md, docs/cli-reference.md, docs/configuration.md, docs/custom-hooks.md, docs/dashboard.md, docs/getting-started.md, docs/index.md, docs/testing.md
Updated configuration file names (hooks-config.jsonpolicies-config.json), field names (customHooksPathcustomPoliciesPath), and CLI flags (--custom-hooks--custom) throughout user-facing documentation and examples.
Type Definitions & Configuration
src/hooks/policy-types.ts, src/hooks/hooks-config.ts, app/actions/get-hooks-config.ts
Updated exported interface HooksConfig to use customPoliciesPath instead of customHooksPath, and switched configuration file paths to policies-config.json with corresponding merge logic updates.
CLI Interface
bin/failproofai.mjs
Added --help/-h command with usage message; replaced --custom-hooks with --custom flag for install; updated --remove-policies to use --custom flag and added removeCustomHooks option; extended known-flag list.
Core Runtime
src/hooks/manager.ts, src/hooks/handler.ts, src/hooks/custom-hooks-loader.ts, src/hooks/llm-client.ts
Updated function signatures and config field references from customHooksPath to customPoliciesPath; added removeCustomHooks parameter to removeHooks; updated error messages and UI strings in manager and llm-client.
UI & Client
app/policies/hooks-client.tsx
Updated conditional rendering and displayed file path to use customPoliciesPath instead of customHooksPath in the Policies tab.
Scripts
scripts/postinstall.mjs
Updated post-install config check to look for policies-config.json instead of hooks-config.json.
E2E & Unit Tests
__tests__/e2e/helpers/fixture-env.ts, __tests__/e2e/hooks/config-scopes.e2e.test.ts, __tests__/e2e/hooks/custom-hooks.e2e.test.ts, __tests__/hooks/block-read-outside-cwd.test.ts, __tests__/hooks/custom-hooks-loader.test.ts, __tests__/hooks/hooks-config.test.ts, __tests__/hooks/manager.test.ts
Updated test fixtures, mocked config files, and assertions to reference policies-config.json and customPoliciesPath; adjusted test descriptions and setup to match new terminology.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 From hooks to policies, we hop with glee,
Config files renamed, terminologies free,
Flags refactored cleanly, like burrows so neat,
A systematic rename, our codebase's treat! 🐇


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@NiveditJain NiveditJain merged commit 6dca3ed into main Apr 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant